# Determine host platform
set(ORBBEC_LIB_PREFIX "lib")
set(ORBBEC_LIB_SUFFIX ".so")
set(ORBBEC_DLL_SUFFIX ".so")

set(OrbbecSDK_ROOT_DIR "/usr/local")

# OrbbecSDK library
set(OrbbecSDK_INCLUDE_DIRS ${OrbbecSDK_ROOT_DIR}/include/)
set(OrbbecSDK_LIBS_DIR ${OrbbecSDK_ROOT_DIR}/lib/)
set(OrbbecSDK_LIBRARY  ${OrbbecSDK_LIBS_DIR}/${ORBBEC_LIB_PREFIX}OrbbecSDK${ORBBEC_LIB_SUFFIX})
set(OrbbecSDK_DLL ${OrbbecSDK_LIBS_DIR}/${ORBBEC_LIB_PREFIX}OrbbecSDK${ORBBEC_DLL_SUFFIX})

add_library(OrbbecSDK::OrbbecSDK SHARED IMPORTED GLOBAL)
set_target_properties(OrbbecSDK::OrbbecSDK PROPERTIES
    IMPORTED_LOCATION ${OrbbecSDK_DLL}
    IMPORTED_IMPLIB ${OrbbecSDK_LIBRARY}
    INTERFACE_INCLUDE_DIRECTORIES ${OrbbecSDK_INCLUDE_DIRS}
)

set(OrbbecSDK_LIBS ${OrbbecSDK_LIBRARY})
file(GLOB OrbbecSDK_DLL_FILES ${OrbbecSDK_LIBS_DIR}/*${ORBBEC_DLL_SUFFIX}*)

# runtime resource file should copy to cwd.
file(GLOB OrbbecSDK_RUNTIME_RESOURCE_FILES  ${OrbbecSDK_LIBS_DIR}/*depthengine*)

# config file
file(GLOB OrbbecSDK_CONFIG_FILES  /opt/OrbbecSDK_v1.10.8/SDK/config/*)

set(OrbbecSDK_FOUND TRUE)